//#include<iostream>
//#include <sys/types.h>
//#include <fcntl.h>
//#include<unistd.h>
//#include<string>
//#include <sys/stat.h>
//#include<vector>
#include"io.h"
int main(){
    umask(0);
    //int fd=open("test.txt",O_RDWR|O_CREAT|O_APPEND,0644);
    //if(fd<0){
    //    std::cout<<"open error"<<std::endl;
    //    return 0;
    //}
    //std::string s="RRRRRRRRRR";
    //char* ts=(char*)malloc(35);
    //write(fd,s.c_str(),s.size());
    //int lseek_result = lseek(fd, 0, SEEK_SET);
    //if (lseek_result == -1) {
    //    perror("lseek");
    //    free(ts);
    //    close(fd);
    //    return 1;
    //}
    //read(fd,ts,30);
    //if(ts==nullptr){
    //    perror("read\n");
    //}
    //std::cout<<(std::string)(ts)<<std::endl;
    //close(fd);
    //auto pf=myopen("test.txt","w");
    //if(pf==nullptr){
    //    return 1;
    //}
    //else{
    //    std::cout<<"成功"<<std::endl;
    //}
    IO_FILE* pf=myopen("test.txt","w");
    if(pf==nullptr){
        perror("myopen");
        return 0;
    }
    mywrite("wwwwww",6,pf);
    myclose(pf);
    return 0;
}
